<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fnx" uri="http://java.sun.com/jsp/jstl/functionsx"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="f" uri="http://www.sctv.com/tags/form"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/WEB-INF/views/head.jsp"/>
    <style type="text/css">
        .view-container .ext{color:#999;}
        .view-container .ext .item{padding:0 5px;}
        .view-container .text{padding:20px 0;}
        img {
            width: 300px;
            heigth: 300px;
        }
    </style>
    <script type="text/javascript">
      $(function() {
        $("#validForm").validate();
        $("input[name='title']").focus();
      });
      function uploadFile(name,button) {
        if($("#f_"+name).val()=="") {alert("<s:message code='pleaseSelectTheFile'/>");return;}
        Cms.uploadFile("../upload_file.do",name,button);
      }
      function uploadVideo(name,button) {
        if($("#f_"+name).val()=="") {alert("<s:message code='pleaseSelectTheFile'/>");return;}
        Cms.uploadFile("../upload_video.do",name,button);
      }
      function uploadImg(name,button) {
        if($("#f_"+name).val()=="") {alert("<s:message code='pleaseSelectTheFile'/>");return;}
        Cms.uploadImg("../upload_image.do",name,button);
      }
      function imgCrop(name) {
        if($("#"+name).val()=="") {alert("<s:message code='noImageToCrop'/>");return;}
        Cms.imgCrop("../../commons/img_area_select.do",name);
      }
      function confirmDelete() {
        return confirm("<s:message code='confirmDelete'/>");
      }
    </script>
</head>
<body class="skin-blue content-body">
<jsp:include page="/WEB-INF/views/commons/show_message.jsp"/>
<c:set var="usernameExist"><s:message code="info.management"/></c:set>
<div class="content-header">
    <h1>报料审核 <small>(<s:message code="info.status"/>: <s:message code="info.status.${bean.status}"/>, ID:${bean.id})</small></h1>
</div>

<div class="content" >
    <div class="box box-primary" >
        <div class="box-header with-border">
            <form id="validForm" action="${oprt=='edit' ? 'update' : 'save'}.do" method="post">
                <tags:search_params/>
                <f:hidden name="queryNodeId" value="${queryNodeId}"/>
                <f:hidden name="queryNodeType" value="${queryNodeType}"/>
                <f:hidden name="queryInfoPermType" value="${queryInfoPermType}"/>
                <f:hidden id="queryStatus" name="queryStatus" value="${queryStatus}"/>
                <f:hidden name="oid" value="${bean.id}"/>
                <f:hidden name="position" value="${position}"/>
                <input type="hidden" id="redirect" name="redirect" value="edit"/>
                <div class="btn-toolbar ls-btn-bar">
                    <shiro:hasPermission name="core:bao:audit_pass">
                    <button class="btn btn-default" type="button" onclick="location.href='baoaudit_pass.do?ids=${bean.id}&redirect=view&queryNodeId=${queryNodeId}&queryNodeType=${queryNodeType}&queryInfoPermType=${queryInfoPermType}&queryStatus=${queryStatus}&position=${pagedList.number*pagedList.size+status.index}&${searchstring}';"<c:if test="${!bean.auditPerm}"> disabled</c:if>><s:message code="info.auditPass"/></button>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="core:bao:audit_reject">
                    <button class="btn btn-default" type="button" onclick="location.href='baoaudit_reject.do?ids=${bean.id}&redirect=view&queryNodeId=${queryNodeId}&queryNodeType=${queryNodeType}&queryInfoPermType=${queryInfoPermType}&queryStatus=${queryStatus}&position=${pagedList.number*pagedList.size+status.index}&${searchstring}';"<c:if test="${!bean.auditPerm}"> disabled</c:if>><s:message code="info.auditReject"/></button>
                    </shiro:hasPermission>

                    <div class="btn-group">
                        <button class="btn btn-default" type="button" onclick="location.href='baolist.do?queryNodeId=${queryNodeId}&queryNodeType=${queryNodeType}&queryInfoPermType=${queryInfoPermType}&queryStatus=${queryStatus}&${searchstring}';"><s:message code="return"/></button>
                    </div>
                </div>
            </form>
        </div>
        <div class="box-body view-container" style="margin-left: 50px;">
            <p class="ext">
                <span class="item">报料人: <c:out value="${bean.creator.username}"/> <c:if test="${!empty bean.creator.realName}">(<c:out value="${bean.creator.realName}"/>)</c:if></span>
            </p>
            <p class="ext">
                <span class="item">报料时间: <fmt:formatDate value="${bean.publishDate}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
            </p>
            <div class="text">
                   报料内容：
            </div>
            <div class="text">
                    <f:textarea name="fullTitle" value="${bean.title}" class="form-control" rows="4" maxlength="150" spellcheck="false"/>
            </div>
            <%--<div class="text">--%>
                <%--报料视频封面：--%>
            <%--</div>--%>
            <%--<div class="text">--%>
                <%--${bean.smallImage}--%>
            <%--</div>--%>
            <div class="text">
                报料视频：
            </div>
            <div class="text">
                <video id="video" class="videoBox" src="${bean.detail.video}" controls></video>
                <i class="iconFont" onclick="videoPlay('video')"></i>
            </div>
            <div class="text">
                报料图片：
            </div>
            <div>
                <c:forEach var="img" varStatus="status" items="${bean.images}">
                    <p class="ext"><span style="color: red">${status.index+1}.</span></p>
                    <p class="ext">
                    <img src="${img.image}" alt="" >
                    </p>
                </c:forEach>
            </div>
        </div>
    </div>
</div>
</body>
</html>